<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('公积金基数调整历史')"/>
    <th:block th:include="include :: layout-latest-css"/>
    <th:block th:include="include :: ztree-css"/>
    <th:block th:include="include :: bootstrap-editable-css"/>
    <th:block th:include="include :: container-css"/>
    <th:block th:include="include :: select2-css"/>
</head>
<style>
    .fixed-table-container .bs-checkbox .th-inner {
        padding: 8px 8px !important;
    }
</style>
<body class="gray-bg">
<div class="modal inmodal fade" id="myModal1" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
                </button>
                <h4 class="modal-title">选择时间段</h4>
            </div>
            <div class="modal-body">
                <p>
                    起始时间: <div class="input-group date">
                <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                <input type="text" class="form-control laydate-demo-2"  placeholder="yyyy-MM-dd">
            </div>
                </p>
                <p>
                    终止时间: <div class="input-group date">
                <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                <input type="text" class="form-control laydate-demo-1"  placeholder="yyyy-MM-dd">
            </div>
                </p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-white" id="close" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary" id="determine">确定</button>
            </div>
        </div>
    </div>
</div>
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <p>工号：</p>
                            <input type="text" name="badge"/>
                        </li>
                        <li>
                            <p>姓名：</p>
                            <input type="text" name="name"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>




        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table" data-mobile-responsive="true"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: layout-latest-js"/>
<th:block th:include="include :: ztree-js"/>
<th:block th:include="include :: bootstrap-table-editable-js"/>
<th:block th:include="include :: hr-help-js"/>
<th:block th:include="include :: datetimepicker-js" />

<script th:inline="javascript">

    var prefix = ctx + "welfare/welfarebaseadjustment/accubaseadjustmenthistory";
    var startingTime;
    var terminationTime;
    $(function () {
        $("#myModal1").modal('show');
        $(".datetimepicker-demo-2").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
        layui.use('laydate', function(){
            var laydate = layui.laydate;
            laydate.render({
                elem: '.laydate-demo-2',
                type: 'date'
            });

        });
        $(".datetimepicker-demo-1").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
        layui.use('laydate', function(){
            var laydate = layui.laydate;
            laydate.render({
                elem: '.laydate-demo-1',
                type: 'date'
            });

        });
        $("#determine").click(function () {
            startingTime =$(".laydate-demo-2").val();
            terminationTime =$(".laydate-demo-1").val();
            getBenefitCitys(startingTime,terminationTime);
            $("#close").click();

        });


    });
    function getBenefitCitys(startingTime,terminationTime) {
        var options={
            code: "id",
            uniqueId: "id",
            url:prefix + "/list?startingTime="+startingTime+"&terminationTime="+terminationTime,
            height: $(window).height() - 120,
            modalName: "福利开启历史",
            columns: [
                [
                    {
                        checkbox: true,
                        rowspan: 2,
                        valign:"middle"
                    },
                    {
                        field: 'id',
                        title: '序号',
                        rowspan: 2,
                        valign:"middle"

                    },
                    {
                        field: 'badge',
                        title: '工号',
                        rowspan: 2,
                        valign:"middle"
                    },
                    {
                        field: 'name',
                        title: '姓名',
                        rowspan: 2,
                        valign:"middle"
                    },
                    {
                        field: 'compName',
                        title: '公司名称',
                        rowspan: 2,
                        valign:"middle"
                    },
                    {
                        field: 'depName',
                        title: '部门名称',
                        rowspan: 2,
                        valign:"middle"
                    },
                    {
                        field: 'jobName',
                        title: '工作岗位',
                        rowspan: 2,
                        valign:"middle"
                    },
                    {
                        field: 'benefitStatus',
                        title: '福利缴纳状态',
                        rowspan: 2,
                        valign:"middle"
                    },
                    {
                        field: 'benefitCity',
                        title: '社保缴纳地区',
                        rowspan: 2,
                        valign:"middle"
                    },
                    {
                        field: 'accuCity',
                        title: '公积金缴纳地区',
                        rowspan: 2,
                        valign:"middle"
                    },
                    {
                        field: 'effectDate',
                        title: '生效日期',
                        rowspan: 2,
                        valign:"middle"
                    },
                    {
                        field: 'remark',
                        title: '备注',
                        rowspan: 2,
                        valign:"middle"
                    },
                    {
                        field: 'regbyName',
                        title: '登记人',
                        rowspan: 2,
                        valign:"middle"
                    },
                    {
                        field: 'regTime',
                        title: '登记时间',
                        rowspan: 2,
                        valign:"middle"
                    },
                    {
                        field: 'initialized',
                        title: '？确认',
                        formatter: function (value, row, index) {
                            if (row.initialized == 1) {
                                return '<i class=\"fa fa-toggle-on text-info fa-2x\" ></i> ';
                            } else {
                                return '<i class=\"fa fa-toggle-off text-info fa-2x\" ></i> ';
                            }
                        },
                        rowspan: 2,
                        valign:"middle"
                    },
                    {
                        field: 'initializedbyName',
                        title: '确认人',
                        rowspan: 2,
                        valign:"middle"
                    },
                    {
                        field: 'initializedtime',
                        title: '确认时间',
                        rowspan: 2,
                        valign:"middle"
                    },
                    {
                        title: '公积金基数',
                        rowspan: 1,
                        colspan: 2,
                        align:"center"
                    },
                ],
                [

                    {
                        field: 'oldXvalue',
                        title: '原基数',
                        rowspan: 1
                    },
                    {
                        field: 'Xvalue',
                        title: '新基数',
                        rowspan: 1
                    }
                ],
            ]
        }


        $.table.init(options);

    }



</script>
</body>
</html>